/*
 * mongeese.h
 *
 *  Created on: Nov 24, 2010
 *      Author: elrom
 */

#ifndef MONGEESE_H_
#define MONGEESE_H_



#include "mongoose.h"
#include "stdio.h"


class mongeese {
public:
	mongeese();
	virtual bool callback(mg_event event, mg_connection *conn,const mg_request_info *request_info){return NULL;};
	virtual ~mongeese();

private:
	mg_context* context_;

	static void * callbackstatic(mg_event event, mg_connection *conn,const mg_request_info *request_info)
	{
		//temp var for clarity - for now.
		mongeese * temp;
		temp = static_cast<mongeese*>((conn->ctx)->geese);
		return reinterpret_cast<void*>(temp->callback(event,conn,request_info));
	};
};

/*
static void callback(mg_event event, mg_connection *conn,const mg_request_info *request_info)
{

    //All we do here is call the do_work() function
    reinterpret_cast<mongeese *>(conn->ctx.geese).connectionMade();
}
*/

#endif /* MONGEESE_H_ */
